Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: link the SDL library statically #2068

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

certik
Copy link
Contributor

@certik certik commented Sep 17, 2024

This allows to run the executable on windows using:

.build/bin/sdl_example

Previously it would give an error message that "SDL.dll" was not found.

This allows to run the executable on windows using:

    .build/bin/sdl_example

Previously it would give an error message that "SDL.dll" was not found.
@certik certik changed the title SDL: link the library statically fix: link the SDL library statically Sep 17, 2024
@certik
Copy link
Contributor Author

certik commented Sep 17, 2024

I tested on Windows natively (in a shell) and on Linux (in WSL) and it works for me in both.

@baszalmstra
Copy link
Contributor

This looks fine, but it did work when using pixi run right?

@certik
Copy link
Contributor Author

certik commented Sep 18, 2024

Yes, the main works with pixi run start.

Also this PR needs to be tested on macOS, the static linking might not work there.

@ruben-arts
Copy link
Contributor

Thanks @certik, assigned our Mac users to test it, if they approve we can merge it!

@tdejager
Copy link
Contributor

Although its nice to run it without pixi r start, is this something we want to use as an example as not all libraries have static counterparts on conda.

@certik
Copy link
Contributor Author

certik commented Sep 19, 2024

Is there a way on Windows to make the program just work by finding the "dll" libraries automatically? Or is static linking the only option?

On Linux and macOS you can use rpath that seems to work pretty well, alleviating most issues with shared libraries.

@baszalmstra
Copy link
Contributor

I dont think there is something like rpath, but if the dlls are next to the executable that would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants